<template>
<div>
  <div class="right">
    <van-sidebar v-model="activeKey" @change="onChange" >
      <van-sidebar-item :title="i.title" v-for="i  in items" :key="i" />
    </van-sidebar>

  </div>
</div>
</template>

<script>
import { ref } from 'vue';
export default {
name: "left",
  data(){
  return{
    items: [],
    activeId:ref(1),
    activeIndex:ref(),
    activeKey:80
  }
  },
  methods:{
    get_role(){
      this.myaxios('http://localhost:5000/user_permissions','get',{'id':localStorage.getItem('usrid')})
          .then(res=>{
            console.log(res)
            this.items=res.res
            console.log(this.items)
          })
    },
    onChange:function(index){
      console.log(this.activeKey)
      console.log(index)
      this.$emit('id',this.activeKey)
    }
  },
  mounted() {
  this.get_role()
  }
}
</script>

<style scoped>

</style>
